package com.zhongshengnetwork.rightbe.dbmodel;

import com.zhongshengnetwork.rightbe.gsonmodel.CollectModel;

import org.xutils.db.annotation.Column;
import org.xutils.db.annotation.Table;

@Table(name = "commentdb")
public class CommentdbModel {


    public static final String WJ = "WJ";//微句
    public static final String WJC = "WJC";//微句评论
    public static final String WZT = "WZT";//微纸条内容
    public static final String WZTC = "WZTC"; //微纸条评论
    public static final String WZTCC = "WZTCC";// 微纸条内容评论

    public static final String LP = "LP";//微纸条
    public static final String pageSize = "35";

    public static String getSourceId(CollectModel collectModel){
        String id = collectModel.getSourceid();
        if (collectModel.getType() == 0){//微句评论
            id = CommentdbModel.WJC + id;
        }else if (collectModel.getType() == 1){//微句
            id = CommentdbModel.WJ + id;
        }else if (collectModel.getType() == 2){//微纸条内容
            id = CommentdbModel.WZT + id;
        }else if (collectModel.getType() == 3){
            if (collectModel.getFromSourceId().length() == 32){//微纸条内容评论
                id = CommentdbModel.WZTCC + id;
            }else {//微纸条评论
                id = CommentdbModel.WZTC + id;
            }
        }
        return id;
    }

    public static String getDataId(String id){
        if (id.length() == 32){
            return  CommentdbModel.WZT + id;
        }else {
            return CommentdbModel.LP + id;
        }
    }

    @Column(name = "sourceid", isId = true)
    private String sourceid;

    @Column(name = "content")
    private String content;

    public String getSourceid() {
        return sourceid;
    }

    public void setSourceid(String sourceid) {
        this.sourceid = sourceid;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}
